package com.myappengine.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.myappengine.service.UploadedFileService;

@Controller
@RequestMapping("/uploadedFile")
public class UploadedFileController {
	
	@Autowired
	private UploadedFileService uploadedFileService;
	
	@RequestMapping(value = "/delete/{fileKey}", method = RequestMethod.GET)
	public String deleteUploadedFile(@PathVariable("fileKey") String fileKey) {
		uploadedFileService.deleteUploadedFile(fileKey);
		return "redirect:/students";
	}
}
